<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
        .active {
            width: 100px;
            height: 100px;
            border: 1px solid skyblue;
        }
        
        .error {
            background-color: orange;
        }
    </style>
</head>

<body>
    <div id="app">
        <div v-bind:class="[activeClass,errorClass]"></div>
        <button @click="handle">切换</button>
    </div>
    <script src="./vue.js"></script>
    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                activeClass: 'active',
                errorClass: 'error',
            },
            methods: {
                handle: function() {
                    this.activeClass = '';
                    this.errorClass = '';
                },
            },
        });
    </script>
</body>

</html>